﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace k_mean_clustering
{
    class MultithreadedSum
    {
        private int a;

        public MultithreadedSum()
        {
            a = 0;
            Thread thread1 = new Thread(new ThreadStart(sum));
            Thread thread2 = new Thread(new ThreadStart(sum));
            thread1.Start();
            thread2.Start();
            thread1.Join();
            thread2.Join();
            Console.WriteLine(a);
        }

        private void sum()
        {
            for (int i = 0; i < 1000000000; i++)
            {
                a = a + 1;
            }
        }

        
    }
}


